<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建虚拟 DOM 对象 - JSX</title>
</head>
<body>
    <div id="root"></div>

    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
        //真实 DOM
        // let root = document.querySelector('#root');
        //虚拟 DOM. 是 react 内部生成的一种对象. 最终会被渲染到页面中, 生成真实 DOM
        // let vDOM = <h1>我是虚拟 DOM 哦</h1>;
        let vDOM = <div className="news">
                <h2 title="abc">最折磨人的或许不是一场惨烈战争，而是烦琐的日常生活。</h2>
                <p id="author">亦舒</p>
            </div>;  // jsx

        ReactDOM.render(vDOM, document.querySelector("#root"));
    </script>
</body>
</html>